package com.lipaluma.field.mapper;

import java.lang.reflect.Field;
import java.util.List;

import com.lipaluma.context.Context;
import com.lipaluma.field.adaptor.Adaptor;
import com.lipaluma.xml.mapping.XmlFieldMapping;

/**
 * This interface is neccessary to allow that your column can add dynamically a
 * new adaptor
 * 
 * @author mario.soares
 */
public interface FieldAdaptedOnEachValue {

	/**
	 * init the Adaptor on each value by annotations
	 * 
	 * @param context 
	 * @param field Field of the target entity
	 * 
	 * @return the Adaptor
	 */
	void initAdaptorOnEachValue(Context context, Field field);

	/**
	 * init the Adaptor on each value by the xml mapping
	 * 
	 * @param context 
	 * @param field field of the target entity
	 * @param element the xml element
	 * @return the Adaptor
	 */
	void initAdaptorOnEachValue(Context context, Field field, XmlFieldMapping mapping);

	/**
	 * Add a new adaptor on column
	 * 
	 * @param adaptor
	 */
	void addNewAdaptorOnEachValue(Adaptor adaptor);

	/**
	 * 
	 * @param extractedValues
	 * @return
	 */
	List<String> adaptEachValues(List<String> extractedValues);

	/**
	 * return the field associated
	 * @return field the field
	 */
	Field getField();

}